POST
/
nous
/
ab-testing
/
experiments
curl --request POST \
  --url https://api.sophra.org/api/nous/ab-testing/experiments \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "search-ranking-test",
  "description": "Testing new search ranking algorithm",
  "startDate": "2024-03-25T00:00:00Z",
  "endDate": "2024-04-25T00:00:00Z",
  "configuration": {
    "variants": [
      {
        "id": "control",
        "name": "Control Group",
        "weight": 0.5,
        "config": {
          "layout": "standard",
          "resultsPerPage": 10,
          "showThumbnails": true
        }
      },
      {
        "id": "variant_a",
        "name": "Test Variant",
        "weight": 0.5,
        "config": {
          "layout": "enhanced",
          "resultsPerPage": 15,
          "showThumbnails": true
        }
      }
    ],
    "trafficAllocation": 0.2,
    "targetMetrics": [
      "click_through_rate",
      "conversion_rate"
    ]
  }
}'
{
  "success": true,
  "data": {
    "experimentId": "<string>",
    "status": "created",
    "variants": [
      {}
    ]
  }
}

Body

application/json

Response

201 - application/json

Experiment created successfully

The response is of type object.